package app.home.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import app.home.dao.UserMapper;
import app.home.model.User;
import app.home.service.UserService;

@Service("userService")
public class UserServiceImpl implements UserService {

	private UserMapper mapper;
	
	public UserMapper getUserMapper() {
		return mapper;
	}
	
	@Autowired
	public void setUserMapper(UserMapper mapper){
		this.mapper = mapper;
	}
	
	@Override
	public List<User> select() {
		return mapper.selectAll();
	}

	@Override
	public List<User> getAll2() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<User> getAll3() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Integer save(User info) {
		info.setUtime(System.currentTimeMillis());
		return mapper.updateByPrimaryKeySelective(info);
	}

	@Override
	public User find(String uid) {
		return mapper.selectByPrimaryKey(uid);
	}

}
